package gestoremulte.pack;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
/*
 * Dialog utilizzato per entrare in modalità offline
 */
public class CustomDialogLoginOffline extends Dialog implements OnClickListener {

	private Button ok;
	private EditText pass;
	//private Intent intent;
	
	public CustomDialogLoginOffline(Context context) {
		super(context);
		//this.intent = intent;
		// TODO Auto-generated constructor stub
	}

	 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.offlinelogin);
        
        ok = (Button) findViewById(R.id.oklogineofflinebutton);
        ok.setOnClickListener(this);
        
        pass = (EditText) findViewById(R.id.passloginoffline);
	 }

	@Override
	public void onClick(View v) {
		
		String text = pass.getText().toString();
		if (text.equals("a")){
			
			dismiss();
		}
		else
			Toast.makeText(getContext(), "login fallito "
			          , Toast.LENGTH_SHORT).show();
			    
	}
	 			
}
